<style>
    #notice-detail {
        padding: 20px 25px 25px 0;
    }
    img[src=""],img:not([src]){

        opacity:0;

    }
</style>

<div class="layui-fluid" id="notice-detail">
    <form class="layui-form" action="" lay-filter="notice-detail-form">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label ">通知图片：</label>
            <div class="layui-upload">
                <img class="layui-upload-img" data-th-src="${img}" width="200px" id="imgNotice" height="100px" name="imgUrl">
            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label ">通知标题：</label>
            <div class="layui-input-block">
                <input type="text" id="txtTitle" data-th-value="${noticeTitle}" name="title" minlength="2" maxlength="50"
                       autocomplete="off" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">公司名：</label>
            <div class="layui-input-block">
                <input type="text" id="txtCompany" data-th-value="陕西全务" minlength="4" maxlength="100"
                       autocomplete="off" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建人：</label>
            <div class="layui-input-block">
                <input type="text" id="txtCreateUser"   name="username" data-th-value="${noticeName}" minlength="2" maxlength="100"
                       autocomplete="off" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建日期：</label>
            <div class="layui-input-block">
                <input type="text" data-th-value="${createDateTime}"   disabled="true" name="createTime" id="txtCreateTime" minlength="4" maxlength="100"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label ">通知内容：</label>
            <div class="layui-input-block">
                <textarea name="content" data-th-text="${noticeContent}" id="txtContent" maxlength="100" class="layui-textarea" readonly></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label ">通知视频：</label>
            <div class="layui-upload">
                <div class="layui-upload-list" style="float: left">
                    <a class='layui-icon layui-icon-file-image'  target='_blank' data-th-href="${noticevoid}" id="noticeVideo" name="videoUrl" controls="controls" >
                        视频
                    </a>
                </div>
            </div>
            <!--<div class="layui-input-block">-->
                <!--<button type="button" class="layui-btn" id="noticeVideo" name="videoUrl"><i class="layui-icon"></i>上传视频-->
                <!--</button>-->
            <!--</div>-->
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label ">通知附件：</label>
            <div class="layui-upload-list" style="float: left">
                <a class='layui-icon layui-icon-file-image' target='_blank' data-th-href="${fileurl}">附件</a>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md10">
                <div class="layui-form-item" style="margin-left: 10px">
                    <label class="layui-form-label febs-form-item-require">接收人：</label>
                    <div class="layui-input-block">
                        <input type="text" id="txtAdvice" data-th-value="${noticeUserId}" name="userId" lay-verify="" autocomplete="off"
                               class="layui-input" readonly>
                    </div>
                </div>
            </div>
        </div>

    </form>
</div>
<script>
    layui.use(['febs', 'form', 'xmSelect', 'validate', 'laydate','dropdown', 'jquery', 'table'], function () {
        let $ = layui.$,
            febs = layui.febs,
            layer = layui.layer,
            form = layui.form,
            laydate = layui.laydate,
            dropdown=layui.dropdown,
            jquery=layui.jquery,
            table=layui.table,
           // notice = [[${noticeUserId}]],
            $view = $('#notice-detail'),
            $student = $view.find('#student'),
            validate = layui.validate;

        form.verify(validate);
        form.render();

//        initCollegeValue();
//        function initCollegeValue() {
//            form.val("notice-detail-form", {
//                "userId": notice,
//            });
//        }




        //进入学生的页面跳转控制器
        $student.on('click',function () {
            var selectUser= febs.modal.open('选择学生', 'student/list', {
                area: $(window).width() <= 750 ? '95%' : '50%',
                btn: ['选择勾选结果', '选择本页结果','选择全部结果'],
                yes: function (index, layero) {
                    $('#select-student').find('#btnCheckResults').trigger('click');
                },
                btn2: function (index, layero) {
                    $('#select-student').find('#btnPageResults').trigger('click');
                },
                btn3: function (index, layero) {
                    $('#select-student').find('#btnAllResults').trigger('click');
                },
                success: function(layero){
                    layero.find('.layui-layer-btn').css('text-align', 'center');
                },
            });

        });
        form.on('submit(college-add-form-submit)', function (data) {
            febs.post(ctx + 'notice/add', data.field, function () {
                layer.closeAll();
                febs.alert.success('新增通知成功');
                $('#notice-list').find('#query').click();
            });
//            return false;
        });


    });
</script>